/*
* created by Administrator on 2018/12/17
* 好的代码像粥一样,是得用时间和精力熬的。
*/
/* create by Administrator on 2018/12/16 */
import Vue from 'vue';
import _toast from './toast';
/* eslint-disable*/
const TOAST = (config) => {
  const Toast = Vue.extend(_toast);
  const toastInstance = new Toast({
    data: {
      type: config.type,
      message: config.message,
      interval: config.interval,
    },
  });
  toastInstance.vm = toastInstance.$mount();
  toastInstance.dom = toastInstance.vm.$el;
  document.body.appendChild(toastInstance.dom);
  return toastInstance.vm;
};

export default {
  install (Vue) {
    Vue.prototype.$toast = TOAST
  }
}

